﻿using System.Windows;
using System.Windows.Controls;
using Prism.Regions;

namespace Coniometer.Pages
{
    public partial class SettingPage : UserControl
    {
        private readonly IRegionManager _regionManager;

        public SettingPage(IRegionManager regionManager)
        {
            InitializeComponent();
            _regionManager = regionManager;
        }

        private void SettingPage_Loaded(object sender, RoutedEventArgs e)
        {
            _regionManager.RequestNavigate("SettingContentRegion", "SpaceSchemePage");
        }

        private void ListBox_SelectionChanged(object sender, RoutedEventArgs e)
        {
            var region = _regionManager.Regions["SettingContentRegion"];
            switch (MenuListBox.SelectedIndex)
            {
                case 0:
                    region.RequestNavigate("SpaceSchemePage");
                    break;
                case 1:
                    region.RequestNavigate("SimpleSchemePage");
                    break;
                case 2:
                    region.RequestNavigate("PrintSchemePage");
                    break;
                case 3:
                    region.RequestNavigate("TimeSettingPage");
                    break;
                case 4:
                    region.RequestNavigate("DeviceInfoPage");
                    break;
                case 5:
                    region.RequestNavigate("NetworkConfigPage");
                    break;
                case 6:
                    region.RequestNavigate("UserManagementPage");
                    break;
                case 7:
                    region.RequestNavigate("HelpCenterPage");
                    break;
                case 8:
                    region.RequestNavigate("CalibrationPage");
                    break;
            }
        }
    }
}